/*
 * XML Type:  ConditionEvent
 * Namespace: http:///org/isistan/flabot/coremodel.ecore
 * Java type: org.isistan.flabot.coremodelEcore.ConditionEvent
 *
 * Automatically generated - do not modify.
 */
package org.isistan.flabot.coremodelEcore.impl;
/**
 * An XML ConditionEvent(@http:///org/isistan/flabot/coremodel.ecore).
 *
 * This is a complex type.
 */
public class ConditionEventImpl extends org.isistan.flabot.coremodelEcore.impl.NamedElementModelImpl implements org.isistan.flabot.coremodelEcore.ConditionEvent
{
    private static final long serialVersionUID = 1L;
    
    public ConditionEventImpl(org.apache.xmlbeans.SchemaType sType)
    {
        super(sType);
    }
    
    private static final javax.xml.namespace.QName ASSOCIATEDCONDITIONS$0 = 
        new javax.xml.namespace.QName("", "associatedConditions");
    private static final javax.xml.namespace.QName CONDITIONEVENT$2 = 
        new javax.xml.namespace.QName("", "conditionEvent");
    private static final javax.xml.namespace.QName DESCRIPTION$4 = 
        new javax.xml.namespace.QName("", "description");
    
    
    /**
     * Gets array of all "associatedConditions" elements
     */
    public org.isistan.flabot.coremodelEcore.Condition[] getAssociatedConditionsArray()
    {
        synchronized (monitor())
        {
            check_orphaned();
            java.util.List targetList = new java.util.ArrayList();
            get_store().find_all_element_users(ASSOCIATEDCONDITIONS$0, targetList);
            org.isistan.flabot.coremodelEcore.Condition[] result = new org.isistan.flabot.coremodelEcore.Condition[targetList.size()];
            targetList.toArray(result);
            return result;
        }
    }
    
    /**
     * Gets ith "associatedConditions" element
     */
    public org.isistan.flabot.coremodelEcore.Condition getAssociatedConditionsArray(int i)
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.isistan.flabot.coremodelEcore.Condition target = null;
            target = (org.isistan.flabot.coremodelEcore.Condition)get_store().find_element_user(ASSOCIATEDCONDITIONS$0, i);
            if (target == null)
            {
                throw new IndexOutOfBoundsException();
            }
            return target;
        }
    }
    
    /**
     * Returns number of "associatedConditions" element
     */
    public int sizeOfAssociatedConditionsArray()
    {
        synchronized (monitor())
        {
            check_orphaned();
            return get_store().count_elements(ASSOCIATEDCONDITIONS$0);
        }
    }
    
    /**
     * Sets array of all "associatedConditions" element  WARNING: This method is not atomicaly synchronized.
     */
    public void setAssociatedConditionsArray(org.isistan.flabot.coremodelEcore.Condition[] associatedConditionsArray)
    {
        check_orphaned();
        arraySetterHelper(associatedConditionsArray, ASSOCIATEDCONDITIONS$0);
    }
    
    /**
     * Sets ith "associatedConditions" element
     */
    public void setAssociatedConditionsArray(int i, org.isistan.flabot.coremodelEcore.Condition associatedConditions)
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.isistan.flabot.coremodelEcore.Condition target = null;
            target = (org.isistan.flabot.coremodelEcore.Condition)get_store().find_element_user(ASSOCIATEDCONDITIONS$0, i);
            if (target == null)
            {
                throw new IndexOutOfBoundsException();
            }
            target.set(associatedConditions);
        }
    }
    
    /**
     * Inserts and returns a new empty value (as xml) as the ith "associatedConditions" element
     */
    public org.isistan.flabot.coremodelEcore.Condition insertNewAssociatedConditions(int i)
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.isistan.flabot.coremodelEcore.Condition target = null;
            target = (org.isistan.flabot.coremodelEcore.Condition)get_store().insert_element_user(ASSOCIATEDCONDITIONS$0, i);
            return target;
        }
    }
    
    /**
     * Appends and returns a new empty value (as xml) as the last "associatedConditions" element
     */
    public org.isistan.flabot.coremodelEcore.Condition addNewAssociatedConditions()
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.isistan.flabot.coremodelEcore.Condition target = null;
            target = (org.isistan.flabot.coremodelEcore.Condition)get_store().add_element_user(ASSOCIATEDCONDITIONS$0);
            return target;
        }
    }
    
    /**
     * Removes the ith "associatedConditions" element
     */
    public void removeAssociatedConditions(int i)
    {
        synchronized (monitor())
        {
            check_orphaned();
            get_store().remove_element(ASSOCIATEDCONDITIONS$0, i);
        }
    }
    
    /**
     * Gets the "conditionEvent" attribute
     */
    public java.lang.String getConditionEvent()
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.apache.xmlbeans.SimpleValue target = null;
            target = (org.apache.xmlbeans.SimpleValue)get_store().find_attribute_user(CONDITIONEVENT$2);
            if (target == null)
            {
                return null;
            }
            return target.getStringValue();
        }
    }
    
    /**
     * Gets (as xml) the "conditionEvent" attribute
     */
    public org.apache.xmlbeans.XmlString xgetConditionEvent()
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.apache.xmlbeans.XmlString target = null;
            target = (org.apache.xmlbeans.XmlString)get_store().find_attribute_user(CONDITIONEVENT$2);
            return target;
        }
    }
    
    /**
     * True if has "conditionEvent" attribute
     */
    public boolean isSetConditionEvent()
    {
        synchronized (monitor())
        {
            check_orphaned();
            return get_store().find_attribute_user(CONDITIONEVENT$2) != null;
        }
    }
    
    /**
     * Sets the "conditionEvent" attribute
     */
    public void setConditionEvent(java.lang.String conditionEvent)
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.apache.xmlbeans.SimpleValue target = null;
            target = (org.apache.xmlbeans.SimpleValue)get_store().find_attribute_user(CONDITIONEVENT$2);
            if (target == null)
            {
                target = (org.apache.xmlbeans.SimpleValue)get_store().add_attribute_user(CONDITIONEVENT$2);
            }
            target.setStringValue(conditionEvent);
        }
    }
    
    /**
     * Sets (as xml) the "conditionEvent" attribute
     */
    public void xsetConditionEvent(org.apache.xmlbeans.XmlString conditionEvent)
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.apache.xmlbeans.XmlString target = null;
            target = (org.apache.xmlbeans.XmlString)get_store().find_attribute_user(CONDITIONEVENT$2);
            if (target == null)
            {
                target = (org.apache.xmlbeans.XmlString)get_store().add_attribute_user(CONDITIONEVENT$2);
            }
            target.set(conditionEvent);
        }
    }
    
    /**
     * Unsets the "conditionEvent" attribute
     */
    public void unsetConditionEvent()
    {
        synchronized (monitor())
        {
            check_orphaned();
            get_store().remove_attribute(CONDITIONEVENT$2);
        }
    }
    
    /**
     * Gets the "description" attribute
     */
    public java.lang.String getDescription()
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.apache.xmlbeans.SimpleValue target = null;
            target = (org.apache.xmlbeans.SimpleValue)get_store().find_attribute_user(DESCRIPTION$4);
            if (target == null)
            {
                return null;
            }
            return target.getStringValue();
        }
    }
    
    /**
     * Gets (as xml) the "description" attribute
     */
    public org.apache.xmlbeans.XmlString xgetDescription()
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.apache.xmlbeans.XmlString target = null;
            target = (org.apache.xmlbeans.XmlString)get_store().find_attribute_user(DESCRIPTION$4);
            return target;
        }
    }
    
    /**
     * True if has "description" attribute
     */
    public boolean isSetDescription()
    {
        synchronized (monitor())
        {
            check_orphaned();
            return get_store().find_attribute_user(DESCRIPTION$4) != null;
        }
    }
    
    /**
     * Sets the "description" attribute
     */
    public void setDescription(java.lang.String description)
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.apache.xmlbeans.SimpleValue target = null;
            target = (org.apache.xmlbeans.SimpleValue)get_store().find_attribute_user(DESCRIPTION$4);
            if (target == null)
            {
                target = (org.apache.xmlbeans.SimpleValue)get_store().add_attribute_user(DESCRIPTION$4);
            }
            target.setStringValue(description);
        }
    }
    
    /**
     * Sets (as xml) the "description" attribute
     */
    public void xsetDescription(org.apache.xmlbeans.XmlString description)
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.apache.xmlbeans.XmlString target = null;
            target = (org.apache.xmlbeans.XmlString)get_store().find_attribute_user(DESCRIPTION$4);
            if (target == null)
            {
                target = (org.apache.xmlbeans.XmlString)get_store().add_attribute_user(DESCRIPTION$4);
            }
            target.set(description);
        }
    }
    
    /**
     * Unsets the "description" attribute
     */
    public void unsetDescription()
    {
        synchronized (monitor())
        {
            check_orphaned();
            get_store().remove_attribute(DESCRIPTION$4);
        }
    }
}
